package binary_tree;

public class TreeTest {
    public static void main(String[] args) {
        MYbinarytree binTree=new MYbinarytree();
        binTree.buildTree();
        System.out.println("前序遍历的结果为：");
        binTree.PreorderTraversal(binTree.root);
        System.out.println();
        System.out.println("中序遍历的结果为：");
        binTree.InorderTraversal(binTree.root);
        System.out.println();
        System.out.println("后序遍历的结果为：");
        binTree.PostordeTraversall(binTree.root);
        System.out.println();
        System.out.println("当前二叉树一共有"+binTree.getNode(binTree.root)+"个节点");
        System.out.println();
        System.out.println("当前二叉树一共有"+binTree.getLeafNode(binTree.root)+"个叶子节点");
        System.out.println();
        System.out.println("当前二叉树第3层共有"+binTree.getKNode(binTree.root,3)+"个节点");
        System.out.println();
        System.out.println("当前二叉树打的高度为"+binTree.rootHeight(binTree.root));
        System.out.println();
        System.out.println(binTree.contains(binTree.root,'D'));
        System.out.println();
        System.out.println("层序遍历的结果为：");
        binTree.levelOrde(binTree.root);
        System.out.println();
        System.out.println("层序遍历二叉树的节点总数:"+ binTree.getNodeSequence(binTree.root));
    }
}
